<template>
  <div>
    <h1>这是兄弟A</h1>
    <button @click="doData">我要发送数据给兄弟B</button>
  </div>
</template>

<script>
export default {
  data () {
    return {
      name: '鲍勃'
    }
  },
  methods: {
    doData () {
      console.log('emit');
      this.$emit('data-a', this.name)
    }
  }
}
</script>